Think of ARP like a phone book. You know the person's name (IP address), but you need their phone number (MAC address) to actually call them. π
Address Resolution Protocol (ARP) is used to connect Layer 3 (IP address) to Layer 2 (MAC address) in the OSI model. It works only inside the same local network (LAN) or broadcast domain.
When a device wants to send a packet, it only knows the destination IP address. To actually deliver the frame on the local network, it needs the MAC address of that IP.
The process works like this:
"Who has this IP address? Tell me your MAC."
You can view your ARP table using:
arp -a
This works on both Windows and Kali Linux.
arp -a
You may see only one IP mapped to a MAC address, usually your router.
ping <device_ip>
arp -a
You will see that the pinged device has been added to your ARP table.
Conclusion: This shows how ARP dynamically learns and stores mappings.
ARP has no authentication mechanism.
When a device receives an ARP reply, it blindly trusts the information and updates its ARP table. It does not verify whether the sender is legitimate.
192.168.20.2192.168.20.1AA:AA:AA:AA:AA:AAThe phoneβs ARP table contains:
192.168.20.1 β AA:AA:AA:AA:AA:AA
If an attacker sends a forged ARP reply claiming:
192.168.20.1 β Attacker's MAC
The phone will update its ARP table and start sending traffic to the attacker instead of the real router.
This is the foundation of:
sudo ip neigh flush all
arparp -a
You will notice that the router entry may appear again even without manual pinging.
Why does this happen?
5. Connect a new phone to the Wi-Fi network.
You will capture its ARP request in Wireshark as it tries to resolve the gateway.